package com.dbsop.domain.params;

import com.dbsop.domain.EsCondition;
import com.dbsop.domain.info.Params;
import com.dbsop.mapper.IndexMappingInfo;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class DeleteParams implements Params {

    private IndexMappingInfo indexInfo;

    private EsCondition esCondition ;

    public DeleteParams(IndexMappingInfo indexInfo, EsCondition esCondition ) {
        this.indexInfo = indexInfo;
        this.esCondition = esCondition;
        indexHandler();
    }


    @Override
    public String[] getIndex() {
        return  esCondition.getIndices();
    }

    @Override
    public void indexHandler() {
        String[] indices = esCondition.getIndices();
        if (indices !=null && indices.length>0){
            return ;
        }
        esCondition.addIndex(indexInfo.queryIndex());
    }
}
